import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { SqlSugarPagedList } from '/@/api/BaseDto';
import { BasPrintDraftInput } from './dto/BasPrintDraftInput';
import { BasPrintDraftPageInput } from './dto/BasPrintDraftPageInput';
import { BasPrintDraftOutput } from './dto/BasPrintDraftOutput';
import { BasPrintDraftQueryInput } from './dto/BasPrintDraftQueryInput';
import { BasPrintGetDataAndTemplateOutput } from './dto/BasPrintGetDataAndTemplateOutput';

export type { BasPrintDraftInput, BasPrintDraftPageInput, BasPrintDraftOutput, BasPrintDraftQueryInput, BasPrintGetDataAndTemplateOutput };
const service = 'basPrintDraft/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasPrintDraftApi = {
	page: (data?: BasPrintDraftPageInput) => {
		return axiosPost(service + 'page', data) as Promise<SqlSugarPagedList<BasPrintDraftOutput>>;
	},
	get: (id: number) => {
		return axiosGet(service + `get/${id}`) as Promise<BasPrintDraftOutput>;
	},
	add: (data?: BasPrintDraftInput) => {
		return axiosPost(service + 'add', data) as Promise<number>;
	},
	update: (data?: BasPrintDraftInput) => {
		return axiosPut(service + 'update', data) as Promise<boolean>;
	},
	queryOnly: (data: any) => {
		return axiosPost(service + 'queryOnly', data) as Promise<BasPrintGetDataAndTemplateOutput>;
	},
	queryDataAndTemplate: (data: any) => {
		return axiosPost(service + 'queryDataAndTemplate', data) as Promise<BasPrintGetDataAndTemplateOutput>;
	},
	query4Tabulator: (data: any) => {
		return axiosPost(service + 'query4Tabulator', data) as Promise<BasPrintGetDataAndTemplateOutput>;
	},
};
